package com.zlc.common.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 数据权限枚举
 *
 * ALL|DEPT|SELF|CUSTOM
 */
@Getter
@AllArgsConstructor
public enum DataRoleEnum {


    ALL("ALL","全部权限"),
    DEPT("DEPT","部门权限"),
    SELF("SELF","仅查自己"),
    CUSTOM("CUSTOM","自定义权限");

    final String type;
    final String remark;

    public static DataRoleEnum typeValue(String typeValue){
        DataRoleEnum[] values = DataRoleEnum.values();
        for(DataRoleEnum typeEnum : values){
            if(typeEnum.getType().equals(typeValue)){
                return typeEnum;
            }
        }
        return null;
    }
}
